<!DOCTYPE HTML>
<html style="background: #f3f3f3">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>法援宝</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/lawyer.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
</head>
<body>
<div id="secHeader">
  <header class="header">
      <a href="javascript:void(0);" onclick="api.closeWin()" class="back_btn"><img src="../image/head-fanhui.png" alt=""></a>
      <h2>保全申请</h2>
      <!--<a href="tel:12345678910" class="search_btn set_btn"><img src="../image/tel.png" alt=""></a>-->
  </header>
</div>

<section class="apply_section">
    <div class="release_list">
        <ul>
            <li>
                <div class="release_item">
                    <p>姓名</p>
                    <input type="text" placeholder="请输入真实姓名" id='name'>
                </div>
            </li>
            <li>
                <div class="release_item">
                    <p>电话</p>
                    <input type="text" placeholder="请输入联系电话" id='phone'>
                </div>
            </li>
            <li>
                <div class="release_item">
                    <p>法院信息</p>
                    <input type="text" placeholder="请输入法院信息" id='depart'>
                </div>

            </li>
            <li>
                <div class="release_item">
                    <p>标的金额(万元)</p>
                    <input type="text" placeholder="请输入标的金额" id='money'>
                </div>

            </li>

        </ul>
    </div>
</section>
<section class="calc_btn">
    <a href="javascript:void (0);" onclick="tijiao()">提交信息</a>
</section>

</body>

<script>
    apiready = function () {
      $api.fixStatusBar( $api.dom('#secHeader') );
      api.setStatusBarStyle({
          style: 'light'
      });
        
    };
    function tijiao(){
        var name=$('#name').val();
        var phone=$('#phone').val();
        var depart=$('#depart').val();
        var money=$('#money').val();
        if(name==''){
            api.alert({msg:"请输入姓名！"});return;
        }
        if(phone==''){
            api.alert({msg:"请输入手机号！"});return;
        }else if(phone.length != 11){
            api.alert({msg:"手机号格式错误！"});return;
        }
        if(depart==''){
            api.alert({msg:"请输入法院名称！"});return;
        }
        if(money==''){
            api.alert({msg:"请输入标的金额！"});return;
        }else if(!/^\d+$/.test(money)){
            api.alert({msg:"金额必须是数字！"});return;
        }


        var  p={token:token,model:'baoquan',name:name,phone:phone,depart:depart,money:money};

        api.ajax({
            url: webSiteUrl+'/app/user/apply',
            method: 'post',
            data: {
                values:p,
            }
        }, function(ret, err) {
            if(ret.code==200){

                alert(ret.msg);
                aaplay('find');
            }else{
                alert(ret.msg)
            }

        });
    }

</script>
</html>
